import { Pipe, PipeTransform } from '@angular/core';

/**
 * 一个转换股票market的Pipe
 * 
 * @export
 * @class TransMarketPipe
 * @implements {PipeTransform}
 */
@Pipe({
  name: "transMarket"
})

export class TransMarketPipe implements PipeTransform {
  transform(value: string, args: any[]): string {
    let retString = "";
    switch (value) {
      case "XSHG.ESA.M":
        retString = "上证A股";
        break;
      case "XSHG.ESB":
        retString = "上证B股";
        break;
      case "XSHE.ESA.M":
        retString = "深证A股";
        break;
      case "XSHE.ESB":
        retString = "深证B股";
        break;
      case "XSHE.ESA.SMSE":
        retString = "中小板";
        break;
      case "XSHE.ESA.GEM":
        retString = "创业板";
        break;
      case "XSHG.MRI":
      case "XSHE.MRI":
        retString = "沪深指数";
        break;
      case "XBHS.GN":
        retString = "概念板块";
        break;
      case "XBHS.HY":
        retString = "行业板块";
        break;
      case "XBHS.DY":
        retString = "地域板块";
        break;
      case "XBHS.ZJHHY":
        retString = "证监会行业";
        break;
    }
    return retString;
  }
}